public enum TestEnum {   //在类外不能够反射枚举类
    RED("red",1),BALCK("black",2),BLUE("blur",3);
    public String color;
    public int num; 
    private TestEnum(String color,int num){  //enum的构造放法默认为私有的
        this.color=color;
        this.num=num;
    }

    public static void main2(String[] args) {
        TestEnum[] testEnums=TestEnum.values();
        for (int i = 0; i <testEnums.length ;i++) {
            System.out.print(testEnums[i]+" "+testEnums[i].ordinal());
        }
    }
    public static void main1(String[] args) {

        TestEnum color=RED;
        switch(color){
            case BALCK:
                System.out.println("Black");
                break;
            case RED:
                System.out.println("RED");
                break;
            case BLUE:
                System.out.println("Blue");
                break;
            default:
                System.out.println("color erro");
                break;
        }

    }
}
